/**
* Created by Administrator on 2025/5/9.
* */
#include "AppDelegate.h"
#include "GlobalParameters.h"
#include <string>
#include "ManualLabel/ManualLabel.h"
#include "MyDeviceReader/MyDeviceReader.h"
#include "MyDeviceWriter/MyDeviceWriter.h"

void AppDelegate::onConfigure(device_config_t *config){
    config->calculationPoolSize=8;
    config->globalParametersInstance = GlobalParameters::shareInstance();
    config->deviceId=10;
    config->servicePort=55261;
    config->ip="192.168.1.115";
    config->userVersion="1.0";
}

void AppDelegate::onStart(){
    REGISTER_RUNTIME_LOADED_CLASSES(ManualLabel,MyDeviceReader,MyDeviceWriter);
    auto manualLabel = new ManualLabel();

    auto radarlabReader = new MyDeviceReader();
    radarlabReader->addTaskModule(manualLabel,0,1024);

    auto radarlabWriter = new MyDeviceWriter();
    manualLabel->addDeviceWriter(0,radarlabWriter,1024);

    auto radarlabWriter_4 = new MyDeviceWriter();
    manualLabel->addDeviceWriter(1,radarlabWriter_4,1024);
    REGISTER_INSTANCES(manualLabel,radarlabReader,radarlabWriter,radarlabWriter_4);
}
